//
//  TSMessage+Category.m
//  BytalkApp
//
//  Created by Conan Wang on 15/4/18.
//  Copyright (c) 2015年 zhihuiguan. All rights reserved.
//

#import "TSMessage+Category.h"

@implementation TSMessage (Category)


+ (void)showMessage:(NSString *)message
               type:(TSMessageNotificationType)type
{
    [self showMessage:[self defaultViewController] message:message type:type];
}

+ (void)showMessage:(UIViewController *)view
            message:(NSString *)message
               type:(TSMessageNotificationType)type
{
    CGFloat duration = [message length]*0.1;
    if (duration < 1.5) {
        duration = 1.5;
    }
    
    [self showMessage:view message:message type:type duration:duration];
}


+ (void)showMessage:(UIViewController *)view
            message:(NSString *)message
               type:(TSMessageNotificationType)type
           duration:(NSTimeInterval)duration
{
    
    [self showNotificationInViewController:view title:message subtitle:nil image:nil type:type duration:duration callback:nil buttonTitle:nil buttonCallback:nil atPosition:TSMessageNotificationPositionTop canBeDismissedByUser:YES];
}

@end
